import { request } from "@/utils/service"
import type * as CompanyDevelopmentHistory from "./types"

/** 增 */
export function createCompanyDevelopmentHistoryApi(
  data: CompanyDevelopmentHistory.CreateOrUpdateCompanyDevelopmentHistoryRequestData
) {
  return request({
    url: "companyDevelopmentHistory",
    method: "post",
    data
  })
}

/** 删 */
export function deleteCompanyDevelopmentHistoryApi(id: string) {
  return request({
    url: `companyDevelopmentHistory/${id}`,
    method: "delete"
  })
}

/** 改 */
export function updateCompanyDevelopmentHistoryApi(
  data: CompanyDevelopmentHistory.CreateOrUpdateCompanyDevelopmentHistoryRequestData
) {
  return request({
    url: "companyDevelopmentHistory/" + data.id,
    method: "put",
    data
  })
}

/** 查 */
export function getCompanyDevelopmentHistoryApi(
  params: CompanyDevelopmentHistory.GetCompanyDevelopmentHistoryRequestData
) {
  return request<CompanyDevelopmentHistory.GetCompanyDevelopmentHistoryResponseData>({
    url: "companyDevelopmentHistory",
    method: "get",
    params
  })
}

/** 查详情 */
export function getCompanyDevelopmentHistoryDetailApi(id: string) {
  return request<CompanyDevelopmentHistory.GetNewResponeseDetailData>({
    url: `companyDevelopmentHistory/${id}`,
    method: "get"
  })
}
